/**
 * 
 */
package org.cuatrovientos.es;

import java.util.Scanner;

/**
 * A class to manage an array of integers
 * @author daniel_ancin
 *
 */
public class Array {
	
 private int [] numbers;
 	
	/**
	 * constructor
	 */
 
	public Array (){
		numbers= new int [10];
		
	}
	/**
	 * inits array values
	 */
	public void init(){
		
		Scanner reader = new Scanner (System.in);
		String line="";
		for (int i=0;i<numbers.length; i++){
			System.out.println("Enter a number:");
			line= reader.nextLine();
			numbers[i]= Integer.parseInt(line);
		
		}
	
	}
	
	/**
	 * increment array values
	 */

	public void increment(){

		for (int i=0;i<numbers.length; i++){
		numbers [i]= numbers[i] +1;
	
		}
	}
			
	/**
	 * decrement array values
	 */
		
	public void decrement(){
		
		for (int i=0 ; i<numbers.length; i++){
				numbers [i]--;
			
		}
	}	
	
	/**
	 * Shows total even numbers is the array
	 */
	
	public void even (){
		int counter =0;
		for (int i=0;i<numbers.length; i++){
			if (numbers [i] % 2== 0){
				counter ++;
				
			}
		}
		
		System.out.println("total even numbers: " + counter);
				
	}

}